home *** CD-ROM | disk | FTP | other *** search
- Path: news3.digex.net!usenet
- From: Tom Burket <burket@cpcug.org>
- Newsgroups: comp.lang.c++
- Subject: Re: Need Help Creating DLL with Return Arguments
- Date: Thu, 14 Mar 1996 19:48:44 -0500
- Organization: Capital PC User Group
- Message-ID: <3148BE6C.2E5E@cpcug.org>
- References: <4i7krl$g9i@news2.realtime.net>
- NNTP-Posting-Host: cpcug.org
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- Isn't the top level routine wrong? You should either return the pointer
- to the environment variable in GetEnvironmentVar or copy the data from
- the returned pointer into the rtn_value pointer, as in
- char* p;
- p = getenv(envar);
- if (p != NULL) strcpy(rtn_value,p);
-
- To me it looks like the wrong level of indirection and you shouldn't
- assume the environment variable is set anyway. What if it isn't? You
- will fail.
-